import 'package:flutter_screenutil/screenutil.dart';
import 'package:flutter/material.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/NavigationBar.dart';
import 'package:heyangkuaidai/DemonStrateModule/FirstPage.dart';
import 'package:heyangkuaidai/DemonStrateModule/LoginPage.dart';
import 'AccountFindPage.dart';
class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {

  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, width: 375, height: 667, allowFontScaling: true);
    return Scaffold(
      body:Column(
        children: [
          SizedBox(height: MediaQuery.of(context).padding.top,),
          NavigationBar(true,title: "首页",backCallback: (){
            Navigator.of(context).pushAndRemoveUntil(
              //跳转
                new MaterialPageRoute(builder: (context) => new LoginPage()),
                //清除其他路由
                    (route) => route == null
            );
          },),
          Stack(
            children: [
              Container(
                width: ScreenUtil.screenWidth,
                height: ScreenUtil().setWidth(480),
                child: Image.asset("sources/yy/homePage.png",),
              ),
              Positioned(
                  top: ScreenUtil().setWidth(150),
                  right:0,
                  child:InkWell(
                    onTap: (){
                       Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) => new FirstPage(),
                  ),
                );
                    },
                    child: Container(
                      width: ScreenUtil().setWidth(100),
                      height: ScreenUtil().setWidth(100),
                    ),
                  )
              ),
              Positioned(
                  top: ScreenUtil().setWidth(150),
                  right:ScreenUtil().setWidth(95),
                  child:InkWell(
                    onTap: (){
                      Navigator.push(
                        context,
                        new MaterialPageRoute(
                          builder: (context) => new AccountFindPage(),
                        ),
                      );
                    },
                    child: Container(
                      width: ScreenUtil().setWidth(100),
                      height: ScreenUtil().setWidth(100),
                    ),
                  )
              ),
            ],
          ),


        ],
      ) ,
    );
  }
}
